<script> 
$("#navMenu").load("/sidebar-inbox.html", function(response, status, xhr) {
	/*  
	if (status == "error") {
	    var msg = "Sorry but there was an error: ";
		alert (msg + xhr.status + " " + xhr.statusText);
	  }*/
	});
</script>
<?php 
$inbox = $mvc->getObject(MailService::INBOX);
?>
<form method="post" action="inbox.html">
<input type="hidden" name="itemSelect" />
<ul class="viewIList">
	<li class="itemNew"><a href="new-mail.html" title="_i18n{New Mail}">_i18n{New Mail}</a></li>
	<li class="itemDelete"><button name="delAll" onclick="return confirm('_i18n{You sure you want to delete?}');" >_i18n{Delete}</button></li>
</ul>
<h2>_i18n{Inbox}</h2>
<div class="unitABlock unitABlockLast">
	<table cellpadding="0" cellspacing="0" class="viewList">
		<thead>
			<tr>
				<th class="itemChk"></th>
				<th>_i18n{From}</th>
				<th>_i18n{Subject}</th>
				<th>_i18n{Date}</th>
				<th class="itemLast">_i18n{Order no.}</th>
			</tr>
		</thead>
		<tbody>
<?php 	if (count($inbox)>0 && $inbox!=NULL){
			foreach ( $inbox as $key=>$mail) { ?>
			<tr <?php echo $mail['opened']==0 ? 'class="unitNoRead"' : null; ?>>
				<td><input type="checkbox" class="inpChk" name="chkM" value="<?php echo $mail[MailService::HASH]; ?>" /></td>
				<td><?php echo $mail[MailService::SENDER]; ?></td>
				<td><a class="linkTr" href="/view-mail.html?id=<?php echo $mail[MailService::HASH]; ?>" title="_i18n{View mail}"><?php echo $mail[MailService::SUBJECT]; ?></a></td>
				<td><?php echo $mail[MailService::CRDATE]; ?></td>
				<td class="itemLast">A55</td>
			</tr>
<?php 		}
		}else {?>
			<tr class="unitNoData">
				<td colspan="5">_i18n{No mail}</td>
			</tr>
<?php	} ?>
		</tbody>
	</table>
</div>
</form>